/**
 * @file TEST_led.c
 * @author Linquan
 * @brief task调度框架 基本运行函数
 * @version 1.0
 * @date 2024-06-06
 *
 * @copyright Copyright (c) 2024
 *
 */

#include "app_config.h"

#if TEST_LED
#include "TEST_led.h"

#include <stdio.h>
#include <time.h>

#include "drv_gpio.h"


int task_led(struct task_args_t *args) 
{
    time_t current_timer;
    char *candlt;
    current_timer = time(NULL);
    candlt = ctime(&current_timer);
    B_GREEN_PRINT("one second task's test : %s\n", candlt);

    /* assert test */
    int a = 1;
    ASSERT_PARAM(a == 0,"this is a assert test");

    return MS_(1000); // 1S
}

/**
 * @brief 按照export 结构体的函数指针 建立函数.添加到任务链表
 *
 * @param ptr
 */
void task_led_add(void *ptr) 
{
     Master_task_add(&task_led, 0); 
}
EXPORT_Lv6_APP_INIT(task_led_add, NULL);

#endif
